package com.bicon.botu.mall.goods.service.impl;

import com.bicon.botu.mall.goods.service.ITranceInfoService;
import com.bicon.botu.mall.goods.entity.TranceDetail;
import com.bicon.botu.mall.goods.entity.TranceInfo;
import com.bicon.botu.mall.goods.mapper.TranceInfoMapper;
import com.bicon.botu.mall.goods.service.ITranceDetailService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 孙永刚
 * @since 2017-08-12
 */
@Transactional
@Service
public class TranceInfoServiceImpl extends ServiceImpl<TranceInfoMapper, TranceInfo> implements ITranceInfoService {

    @Autowired
    private ITranceDetailService service;

    /**
     *保存定制信息
     * @param info 定制信息
     * @param list 微量元素集合
     *
     */
    @Override
    public void saveTranceInfo(TranceInfo info, List<TranceDetail> list) {
        super.insertOrUpdate(info);
        service.insertOrUpdateBatch(list);
    }
}
